﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;

namespace WPFUIAnimation
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        private Storyboard story;
        public MainWindow()
        {
            InitializeComponent();
            story = FindResource("Storyboard1") as Storyboard;
            story.Begin(this, true);
            story.Pause(this);
        }

        private void slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            story.Seek(this, TimeSpan.FromMilliseconds(e.NewValue), TimeSeekOrigin.BeginTime);
        }
    }



}
